package com.alibaba.nacos.client.javajdk.config;

import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;
import org.junit.Test;

import java.util.Properties;

/**
 * @author liyunfei
 */
public class ConfigTests {
    private static final String serverAddr = "localhost";
    private static final String dataId = "hello-tst.text";
    private static final String group = "DEFAULT_GROUP";
    @Test
    public void testGetConfig(){
        try {
            Properties properties = new Properties();
            properties.put("serverAddr", serverAddr);
            ConfigService configService = NacosFactory.createConfigService(properties);
            String content = configService.getConfig(dataId, group, 5000);
            System.out.println(content);
        } catch (NacosException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    
}
